home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pcv06n03.zip / AUTOASK.DOC < prev    next >
Text File  |  1993-06-05  |  2KB  |  48 lines

  1. AUTOASK.COM             March 1993                Dale Lewallen
  2.                                                    Jeff Prosise
  3. ---------------------------------------------------------------
  4. Purpose:  Your lengthy AUTOEXEC.BAT file loads and runs a hard
  5.           disk optimizer.  You recently installed a 500MB hard
  6.           disk that is partitioned into eight drives. With this
  7.           new setup, you don't always want to run the
  8.           optimizing program when you boot your machine. You'd
  9.           like AUTOEXEC.BAT to ask if you want to load a
  10.           particular program; if you don't answer within a
  11.           certain length of time, you'd like to specify a
  12.           default choice so the batch file can continue
  13.           executing.
  14.  
  15. Remarks:  AUTOASK returns the ASCII code of the first key
  16.           pressed, letting you test it with an IF ERRORLEVEL
  17.           command.  If no key is pressed within 10 seconds,
  18.           AUTOASK times out and returns either the ASCII code
  19.           for the letter N or, if you specified a different
  20.           character on the command line, the ASCII code for
  21.           that character.
  22.  
  23.           For example, the following batch file asks if you
  24.           want to run CHKDSK.  Pressing Y or y executes CHKDSK;
  25.           pressing any other key (or allowing the time-out
  26.           counter to expire) ends the batch file without
  27.           executing CHKDSK:
  28.  
  29.                @ECHO OFF
  30.                ECHO Do you want to run CHKDSK?
  31.                AUTOASK
  32.                IF ERRORLEVEL 89 IF NOT ERRORLEVEL 90 GOTO DOIT
  33.                IF ERRORLEVEL 121 IF NOT ERRORLEVEL 122 GOTO
  34.                     ... DOIT
  35.                GOTO END
  36.                :DOIT
  37.                CHKDSK
  38.                :END
  39.  
  40.           AUTOASK can also be set to execute the program when
  41.           the countdown timer runs out.  In the above example,
  42.           you might want CHKDSK to execute when the countdown
  43.           timer expires.  Just set the default response to Y by
  44.           changing the third line of the batch file to
  45.  
  46.                AUTOASK Y
  47.  
  48.